<template>
  <div class="school">
    <h2>学校：{{ name }}</h2>
    <h2>地址：{{ adress }}</h2>
    <button @click="sendSchoolName">点我发送学校名</button>
  </div>
</template>

<script>
export default {
  name: 'School',
  data() {
    return {
      name: '安徽工业大学',
      adress: '马鞍山',
    }
  },
  props: ['getSchoolName'],
  methods: {
    sendSchoolName() {
      this.getSchoolName(this.name)
    },
  },
}
</script>

<style scoped>
.school {
  background-color: rebeccapurple;
}
</style>
